<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>dom ready、onload区别</title>
    <script src="../node_modules/jquery/dist/jquery.min.js"></script>
    <script>
        //dom ready
        $(function(){
            alert('hello');
        });
        
        alert('打酱油');

        //window onload事件
        window.onload = function(){
            alert('!!!!!');
        };
    </script>
</head>
<body>
    <h1>Welcome!</h1>
    <script>
        //最佳实践
        alert('world');
    </script>
</body>
</html>